import * as types from './mutation-types'

export default {
  [types.GET_USER_INFO](state, {
    info,
    isLogin
  }) {
    state.userinfo = info
    state.isLogin = isLogin
  },
  [types.SET_USER_INFO](state, {
    info,
    isLogin,
    callback
  }) {
    state.userinfo = info
    state.isLogin = isLogin
    if (typeof (callback) === 'function') callback()
  },
  // 单位列表
  setOrgOptions(state, value) {
    state.orgOptions = value
  },
  setUserInfor(state, value) {
    state.userinfo = JSON.parse(value)
  },
  // 用于点击消息带条件刷新对应列表
  setListQueryParam(state, value) {
    state.listQueryParam = value
  },
  // 用于刷新未复位警情列表和统计数据
  setUnresetAlarmStamp(state, value) {
    state.unresetAlarmStamp = value
  },
  // 用于刷新已复位警情列表和统计数据
  setResetAlarmStamp(state, value) {
    state.resetAlarmStamp = value
  },
  // 未复位警情导出状态
  setAlarmExporting(state, value) {
    state.alarmExporting = value
  },
  // 已复位警情导出状态
  setResetAlarmExporting(state, value) {
    state.resetAlarmExporting = value
  },
  setRefreshInspectTask(state, value) {
    state.refreshInspectTask = value
  },
  // 隐患整改导出状态
  setResetHiddenDangerExporting(state, value) {
    state.resetHiddenDangerExporting = value
  }
}
